﻿using System;
using Cms.Utilities.UpdateServiceReference;

namespace Cms.Utilities
{
    internal class UpdateServiceWrapper
    {
        public static Version GetLatestVersion()
        {
            try
            {
                IUpdateService updateService = new UpdateServiceClient();
                return new Version(updateService.GetVersionInfo());
            }
            catch (Exception ex)
            {
                Logging.LogError("GetLatestVersion", ex);
            }
            return null;
        }

        public static byte[] GetUpdatePackage()
        {
            try
            {
                IUpdateService updateService = new UpdateServiceClient();
                return updateService.GetUpdatePackage();
            }
            catch (Exception ex)
            {
                Logging.LogError("GetUpdatePackage", ex);
            }
            return null;
        }
    }
}